//
// Created by 11510 on 2024/6/23.
//

#ifndef TEXTQUERY_ANDQUERY_H
#define TEXTQUERY_ANDQUERY_H

#include "BinaryQuery.h"

class AndQuery : public BinaryQuery {
    friend Query operator&(const Query &, const Query &);

    AndQuery(const Query &left, const Query &right) :
            BinaryQuery(left, right, "&") {}

    QueryResult esval(const TextQuery &) const;
};

inline Query operator&(const Query &lhs, const Query &rhs) {
//    隐式类型转换
    return std::shared_ptr<QueryBase>(new AndQuery(lhs, rhs));
}


#endif //TEXTQUERY_ANDQUERY_H
